#include "stdafx.h"

#include "ScreenManager.h"

#include "GameScreen.h"

namespace ETM
{
	namespace GameScreens
	{
		ScreenManager::ScreenManager()
		{
			running = true;
		}

		void ScreenManager::Update(float delta)
		{
			gameScreens.back()->Update(delta);
		}

		void ScreenManager::Render(sf::RenderWindow& window)
		{
			gameScreens.back()->Render(window);
		}

		void ScreenManager::AddScreen(GameScreen* screen)
		{
			screen->SetManager(this);
			screen->Initialize();
			screen->Load();
			gameScreens.push_back(screen);
		}

		bool ScreenManager::IsRunning()
		{
			return running;
		}

		void ScreenManager::Exit()
		{
			running = false;
		}
	}
}